package com.gxl.hessian.demo;

import com.caucho.hessian.client.HessianProxyFactory;

import java.net.MalformedURLException;
import java.text.DateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @Author: zro
 * @Date: 2019-12-6 15:38
 * @Description:
 */
public class client {

    public static void main(String[] args) {
        try {
            String url = "http://localhost:8080/hessian";
            HessianProxyFactory factory = new HessianProxyFactory();
            factory.setOverloadEnabled(true);
            HelloHessian basic = (HelloHessian) factory.create(HelloHessian.class, url);

            System.out.println(basic.sayHello(LocalDateTime.now().format(
                    DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS")
            )));

        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
    }
}
